package com.iptv.grape.bu.process;

import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.domain.AssetPlayData;

import java.util.Date;

// 点播控制
public class VodPlayProcess {



    // 连续播放控制
    public void playContinuously(){

        //AssetPlayData curAssetPlayData = GrapeContext.curGrapeContext().getCurPlayVod();
        //curAssetPlayData.getSubList();
    }

    // 停止播放时调用
    public void stopPlay(int lastSpeed){
        saveVodHis(lastSpeed);
    }

    // 停止播放时调用
    public void saveVodHis(int lastSpeed){

        AssetPlayData curAssetPlayData = GrapeContext.curGrapeContext().getCurPlayVod();
        if(curAssetPlayData != null){
            curAssetPlayData.setCurLastPlayTime(lastSpeed);
            curAssetPlayData.setLastPlayDate(new Date());
            GrapeContext.curGrapeContext().getAssetPlayDataList().serializeToFile();
        }
    }
}
